<template>
  <view class="detail-container">
   
    <!-- Tab切换 -->
   
    <!-- 基本信息 -->
    <view class="form-list">
      <view class="form-item">
        <text class="form-label">户主/塘主：</text>
        <input class="form-input" v-model="detail.owner" disabled />
      </view>
      <view class="form-item">
        <text class="form-label">车牌号码：</text>
        <input class="form-input" v-model="detail.carNo" disabled />
      </view>
      <view class="form-item">
        <text class="form-label">电话号码：</text>
        <input class="form-input" v-model="detail.phone" disabled />
      </view>
      <view class="form-item">
        <text class="form-label">中介：</text>
        <input class="form-input" v-model="detail.center" disabled />
      </view>
      <view class="form-item">
        <text class="form-label">日期：</text>
        <input class="form-input" v-model="detail.date" disabled />
      </view>
    </view>
    <!-- 单据信息 -->
    <view class="form-list">
      <view class="form-item">
        <text class="form-label">总重(市斤)：</text>
        <input class="form-input" v-model="detail.totalWeight" disabled />
      </view>
      <view class="form-item">
        <text class="form-label">皮重：</text>
        <input class="form-input" v-model="detail.tare" disabled />
      </view>
      <view class="form-item">
        <text class="form-label">回皮：</text>
        <input class="form-input" v-model="detail.returnTare" disabled />
      </view>
      <view class="form-item">
        <text class="form-label">净重(市斤)：</text>
        <input class="form-input" v-model="detail.netWeight" disabled />
      </view>
      <view class="form-item">
        <text class="form-label">单价：</text>
        <input class="form-input" v-model="detail.price" disabled />
      </view>
      <view class="form-item">
        <text class="form-label">渔款：</text>
        <input class="form-input" v-model="detail.amount" disabled />
      </view>
      <view class="form-item">
        <text class="form-label">备注：</text>
        <input class="form-input" v-model="detail.remark" disabled />
      </view>
      <view class="form-item">
        <text class="form-label">附件上传</text>
        <view class="upload-box">
          <image class="upload-img" :src="detail.attachment || defaultImg" mode="aspectFit"></image>
        </view>
      </view>
    </view>
    <!-- 底部操作按钮 -->
    <view class="bottom-btns">
      <button class="bottom-btn" @click="viewDetail">查看明细</button>
      <button class="bottom-btn" @click="editOrder">修改</button>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      tab: 'base',
      defaultImg: '/static/upload_placeholder.png',
      detail: {
        owner: '刘刘刘',
        carNo: '粤K 123HH',
        phone: '13632238674',
        center: '刘某某',
        date: '2024-12-15 11:00--12:00',
        totalWeight: '100',
        tare: '20',
        returnTare: '10',
        netWeight: '30',
        price: '5',
        amount: '15000',
        remark: '今日的渔不错',
        attachment: '' // 可替换为实际图片路径
      }
    }
  },
  methods: {
    goBack() {
      uni.navigateBack();
    },
    viewDetail() {
      uni.showToast({ title: '查看明细', icon: 'none' });
    },
    editOrder() {
      uni.showToast({ title: '修改', icon: 'none' });
    }
  }
}
</script>

<style scoped lang="scss">
@import '@/uni.scss';

.detail-container {
  background: #fff;
  min-height: 100vh;
  padding: 0 20rpx 40rpx 20rpx;
}
.detail-header {
  display: flex;
  align-items: center;
  height: 80rpx;
  border-bottom: 1rpx solid #eee;
  margin-bottom: 10rpx;
}
.back-btn {
  font-size: 40rpx;
  color: $primary;
  margin-right: 20rpx;
  width: 60rpx;
  text-align: center;
  cursor: pointer;
}
.header-title {
  font-size: 30rpx;
  font-weight: bold;
  color: #333;
}
.tab-switch {
  display: flex;
  justify-content: center;
  margin: 30rpx 0 20rpx 0;
  gap: 20rpx;
}
.tab-btn {
  flex: 1;
  background: #e6f0fa;
  color: #3b6ca8;
  border: none;
  border-radius: 12rpx;
  font-size: 28rpx;
  padding: 16rpx 0;
}
.tab-btn.active {
  background: #3b6ca8;
  color: #fff;
}
.form-list {
  width: 100%;
}
.form-item {
  display: flex;
  align-items: center;
  margin-bottom: 24rpx;
}
.form-label {
  width: 180rpx;
  font-size: 26rpx;
  color: #333;
  text-align: right;
  margin-right: 12rpx;
  flex-shrink: 0;
}
.form-input {
  flex: 1;
  height: 60rpx;
  border: 1rpx solid #a6d3ff;
  border-radius: 10rpx;
  padding: 0 16rpx;
  font-size: 26rpx;
  background: #f7f7f7;
  color: #333;
}
.upload-box {
  width: 220rpx;
  height: 120rpx;
  border: 4rpx solid #bbb;
  border-radius: 8rpx;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-img {
  width: 200rpx;
  height: 100rpx;
  object-fit: contain;
}
.bottom-btns {
  display: flex;
  justify-content: space-between;
  margin-top: 40rpx;
  gap: 30rpx;
}
.bottom-btn {
  flex: 1;
  height: 70rpx;
  background: #a6d3ff;
  color: #fff;
  border: none;
  border-radius: 12rpx;
  font-size: 28rpx;
}
</style>